__stop = false

repeat
  cls()
  resetAllMotors()
  write("Press the ORANGE", 2)
  write("button to START", 3)
  write("your program", 4)
  write("Press and hold", 6)
  write("the GRAY button", 7)
  write("when FINISHED", 8)

  repeat until isPressed(ENTER) or isPressed(ESCAPE)

  if isPressed(ENTER) then
    __worked, __err = pcall(__main)
    if not __worked then
      cls()
      writeLong(__err)
      print(__err)
      write("Press GRAY...", 8)
      __stop = true
      repeat until isPressed(ESCAPE)
    end
  else 
    __stop = true
  end
until __stop == true

cls()
write("Standalone", 1)
write("program complete", 2)
